package com.leoman.service;

import com.leoman.entity.Comment;
import com.leoman.exception.ParamErrorException;
import com.leoman.exception.UserNotFindException;
import com.leoman.exception.UserSealStatusException;
import com.leoman.service.common.ICommonService;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartRequest;

import java.util.List;

/**
 * CommentService
 * Created by 涂奕恒 on 2016/11/23 0023 下午 3:51.
 */
public interface CommentService extends ICommonService<Comment> {

    // 评论列表（分页）
    Page<Comment> iPageForApp(Integer sourceId, Integer sourceType, Integer userId, Integer type, Integer pageNum, Integer pageSize);

    // 发表评论
    void addComment(Boolean isAdmin,
                    Integer userId,
                    Integer sourceId,
                    Integer sourceType,
                    Integer type,
                    Integer voiceTime,
                    String content,
                    Integer imgNum,
                    MultipartRequest multipartRequest) throws ParamErrorException, UserNotFindException, UserSealStatusException;

    // 查询评论列表
    List<Comment> findListBySourceIdAndType(Integer sourceId, Integer type);

    // 评论列表（分页）
    Page<Comment> pageByParams(String content,
                               String userName,
                               String startTime,
                               String endTime,
                               Integer sourceId,
                               Integer sourceType,
                               Integer pageNum,
                               Integer pageSize);

    // 删除评论
    Integer deleteComment(Integer commentId);

    // 批量删除评论
    Integer batchDelete(String ids);

    // 添加评论
    Integer saveComment(Integer sourceId, Integer type, String content, String tempAddImageIds, String tempDelImageIds);

    // 添加微音评论
    Integer saveComment(Integer sourceId, Integer type, String content, MultipartRequest multipartRequest);

    // 删除对象的所有评论
    Integer deleteAllComment(Integer sourceId, Integer sourceType);
}